import config from "../../config/index.js";
import http from "../../utils/request.js";

export default {
    addConfig: {
        url: `${config.API_URL}/platform/config/add`,
        name: "新增配置",
        post: function (platformConfigAddVo) {
            return http.post(this.url, platformConfigAddVo);
        }
    },
    delConfigs: {
        url: `${config.API_URL}/platform/config/del`,
        name: "多选级联删除配置",
        delete: function (configIds) {
            return http.delete(this.url, configIds);
        }
    },
    editConfig: {
        url: `${config.API_URL}/platform/config/edit`,
        name: "修改配置信息",
        put: function (platformConfigEditVo) {
            return http.put(this.url, platformConfigEditVo);
        }
    },
    updateUserConfig: {
        url: `${config.API_URL}/platform/config/updateUserConfig`,
        name: "更新用户设置",
        put: function (platformUserConfigVo) {
            return http.put(this.url, platformUserConfigVo);
        }
    },
    getConfigById: {
        url: `${config.API_URL}/platform/config/info`,
        name: "根据ID获取配置详情",
        get: function (configId) {
            return http.get(this.url + "/" + configId);
        }
    },
    pageListConfig: {
        url: `${config.API_URL}/platform/config/pageList`,
        name: "分页查询配置列表",
        get: function (platformConfigQueryVo) {
            return http.get(this.url, platformConfigQueryVo);
        }
    },
    initUserConfig: {
        url: `${config.API_URL}/platform/config/initUserConfig`,
        name: "获取系统初始化配置",
        get: function () {
            return http.get(this.url);
        }
    },
    initSystemConfig: {
        url: `${config.API_URL}/platform/config/initSystemConfig`,
        name: "获取系统初始化配置",
        get: function () {
            return http.get(this.url);
        }
    },
    initPlatformConfig: {
        url: `${config.API_URL}/platform/config/initPlatformConfig`,
        name: "获取平台初始化配置",
        get: function () {
            return http.get(this.url);
        }
    },
    getPlatformConfigValueWithDefault: {
        url: `${config.API_URL}/platform/config/getPlatformConfigValueWithDefault`,
        name: "根据配置标识和配置键名获取配置键值",
        get: function (configCode, configKey, defaultValue) {
            return http.get(this.url + '/' + configCode + '/' + configKey + '/' + defaultValue);
        }
    }
}
